package com.guoxue.action.front.pay;

import java.util.Map;

import com.guoxue.pay.bank.com.cib.epay.sdk.common.Configure;
import com.guoxue.pay.bank.com.cib.epay.sdk.common.SignAlgorithm;
import com.guoxue.pay.bank.com.cib.epay.sdk.service.IPostService;
import com.guoxue.pay.bank.com.cib.epay.sdk.util.DateTimeUtil;
import com.guoxue.pay.bank.com.cib.epay.sdk.util.Signature;

public class PostMessage extends IPostService{
	
	private static final String SERVICE_NAME = "cib.epay.acquire.easypay.acctAuth";
	private static final String SERVICE_VER = "01";
	@Override
	public String exec(Map<String, String> params) {
		params.put("ver", SERVICE_VER);
		params.put("service", SERVICE_NAME);
		params.put("appid", Configure.getAppid());
		params.put("timestamp", DateTimeUtil.getDateTime());
        params.put("sign_type", SignAlgorithm.get(SERVICE_NAME));
        params.put("mac", Signature.generateMAC(params));
		return txn(Configure.isDevEnv() ? Configure.EP_DEV_API : Configure.EP_PROD_API, params);
	}

}
